<h3>账号列表</h3>
<table class="admin">
  <tr>
    <th>账号名</th>
    <th>邮箱</th>
    <th>角色</th>
    <th colspan="3" >操作</th>
  </tr>

  <% @users.each do |user| %>
    <tr>
      <th scope="row"class="spec"><%= user.user_name %></th>
      <td><%= user.email %></td>
      <td>

        <% for role in User::ROLES %>

          <% if user.roles.include?(role)%>
            <%= label_tag "user_roles_#{role} ", role.humanize %>
          <%end%>

        <% end %>

      </td>
      <td><%= link_to '签到记录', user %></td>
      <td><%= link_to @edit_name, edit_user_path(user) %></td>
      <td><%= link_to '删除', user, method: :delete, data: { confirm: '确定删除?' } %></td>
    </tr>
  <% end %>
</table>
<br />

<%= link_to '新增账号', new_user_path %>
